<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景尺寸</title>
    <style>
        a {
            text-decoration: none;
        }

        ul {
            list-style: none;
        }

         div{
            background-image: url(http://climg.mukewang.com/582c37e50001b08102000065.jpg);
            width: 100px;
            height: 100px;
            border: 2px solid red;
            background-repeat: no-repeat;
            display: none;
        }
        .length:hover div { 
            background-size: 100px 100px;
            display: block;
        }
        .percent:hover{
            background-size: 50% auto;
            background-image: url(http://climg.mukewang.com/582c37e50001b08102000065.jpg);
            width: 100px;
            height: 100px;
            border: 2px solid red;
            background-repeat: no-repeat;
        }       
         .cover:hover{
            background-size: cover;
            background-image: url(http://climg.mukewang.com/582c37e50001b08102000065.jpg);
            width: 100px;
            height: 100px;
            border: 2px solid red;
            background-repeat: no-repeat;
        }
        .contain:hover{
            background-size: contain;
            background-image: url(http://climg.mukewang.com/582c37e50001b08102000065.jpg);
            width: 100px;
            height: 100px;
            border: 2px solid red;
            background-repeat: no-repeat;
        } 
    </style>
</head>

<body>
    <h2>background-size不同属性值的不同效果</h2>
    <ul>
        <li class="length">
            <h3><a href="">100px 100px</a></h3>
            <div></div>
            <p>652111</p>
        </li>
        <li class="percent">
            <h3><a href="">50% 50%</a></h3>
            <div></div>
        </li>
        <li class="cover">
            <h3><a href="">cover</a></h3>
            <div></div>
        </li>
        <li class="contain">
            <h3><a href="">contain</a></h3>
            <div></div>
        </li>
    </ul>
</body>

</html>